from po.base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    #定位器
    list_loc=(By.XPATH,'/html/body/div/div/section/aside/ul/li/ul/li[13]/a')
    add_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[2]')
    name_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div/div/input')
    data_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div/div/input')
    status_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/input')
    commit_loc=(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/button[1]')

    def list(self):
        self.click(self.list_loc)

    def add(self):
        self.click(self.add_loc)

    def name(self):
        self.send_keys(self.name_loc,'王五')

    def data(self):
        self.send_keys(self.data_loc,'2025-07-16')

    def status(self):
        self.send_keys(self.status_loc,'未发布')

    def commit(self):
        self.click(self.commit_loc)